home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue30 / mmapfile / MMAPFILE.ZIP / README.TXT < prev    next >
Encoding:
Text File  |  1997-06-22  |  1.9 KB  |  51 lines

  1. MMapFile.Zip is a study on using Win32 memory mapped files.
  2. I got interested in this trying to find the best way to share
  3. information between different applications in a package
  4. we distribute at work. Essentially, when a user logs into 
  5. our system, a list of things within our application the
  6. user is permitted to do is created. Wwe didn't want to 
  7. require the user to log into each application he/she may use
  8. simultaneously. After looking into mapped files, I discovered
  9. there are many possible uses for it within our applications.
  10.  
  11. There are several sample programs and one unit named
  12. E_Memmap.pas. This unit implements memory mapping. It
  13. can be used to simply map dynamic data within an application
  14. or map the more permenant disk files. The unit also provides
  15. for synchronization through mutexes. 
  16.  
  17. There are other comments, rules for using and warnings in
  18. E_Memmap.pas.
  19.  
  20. The projects:
  21.  
  22.    Mem1.dpr - My first test project, simply maps an
  23.    integer into memory.
  24.  
  25.    MemX1.dpr - Maps an integer array into memory and
  26.    uses mutexes.
  27.  
  28.    Mem2X.dpr - Maps a large integer array and uses
  29.    mutexes. Maps in half of the total array size
  30.    at a time and allows mapping to either half. That is
  31.    Win32 sets up a map for the whole array but the
  32.    program only gets a view of half it at a time.
  33.  
  34.    MemF1.dpr - Does all of the above but uses a file
  35.    this time and increases the size of the array.         
  36.     
  37. To get a feal for how they work, run two or more instances of the same
  38. exe at the same time, moving between them changing stuff and looking
  39. for the change in each running process. To see how the mutexes work
  40. click to change a value in one app, leave the input window up and
  41. go into another running instance and do the same thing. The second
  42. one will lock on the button press until you close the input window
  43. in the first. 
  44.  
  45. Any comments or suggestions will be greatly appreciated.
  46.  
  47. David Spies
  48.  
  49. DSPIES@onecom.com
  50. davidsp@eastsoft.com
  51.